<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>Class TimeMapping | HiAPI-C# 2025 </title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="title" content="Class TimeMapping | HiAPI-C# 2025 ">
      
      <meta name="description" content="Provides mapping between machining steps and time-based measurements (shots),">
      <link rel="icon" href="../img/HiAPI.favicon.ico">
      <link rel="stylesheet" href="../public/docfx.min.css">
      <link rel="stylesheet" href="../public/main.css">
      <meta name="docfx:navrel" content="../toc.html">
      <meta name="docfx:tocrel" content="toc.html">
      
      <meta name="docfx:rel" content="../">
      
      
      
      <meta name="loc:inThisArticle" content="In this article">
      <meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
      <meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
      <meta name="loc:tocFilter" content="Filter by title">
      <meta name="loc:nextArticle" content="Next">
      <meta name="loc:prevArticle" content="Previous">
      <meta name="loc:themeLight" content="Light">
      <meta name="loc:themeDark" content="Dark">
      <meta name="loc:themeAuto" content="Auto">
      <meta name="loc:changeTheme" content="Change theme">
      <meta name="loc:copy" content="Copy">
      <meta name="loc:downloadPdf" content="Download PDF">

      <script type="module" src="./../public/docfx.min.js"></script>

      <script>
        const theme = localStorage.getItem('theme') || 'auto'
        document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
      </script>

  </head>

  <body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
    <header class="bg-body border-bottom">
      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
        <div class="container-xxl flex-nowrap">
          <a class="navbar-brand" href="../index.html">
            <img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
            
          </a>
          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
            <i class="bi bi-three-dots"></i>
          </button>
          <div class="collapse navbar-collapse" id="navpanel">
            <div id="navbar">
              <form class="search" role="search" id="search">
                <i class="bi bi-search"></i>
                <input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
              </form>
            </div>
          </div>
        </div>
      </nav>
    </header>

    <main class="container-xxl">
      <div class="toc-offcanvas">
        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
          <div class="offcanvas-header">
            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <nav class="toc" id="toc"></nav>
          </div>
        </div>
      </div>

      <div class="content">
        <div class="actionbar">
          <button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
            <i class="bi bi-list"></i>
          </button>

          <nav id="breadcrumb"></nav>
        </div>

        <article data-uid="Hi.Mapping.TimeMapping">



  <h1 id="Hi_Mapping_TimeMapping" data-uid="Hi.Mapping.TimeMapping" class="text-break">
Class TimeMapping  
  </h1>

  <div class="facts text-secondary">
    <dl><dt>Namespace</dt><dd><a class="xref" href="Hi.html">Hi</a>.<a class="xref" href="Hi.Mapping.html">Mapping</a></dd></dl>
  <dl><dt>Assembly</dt><dd>HiMech.dll</dd></dl>
  </div>

  <div class="markdown summary"><p>Provides mapping between machining steps and time-based measurements (shots),</p>
</div>
  <div class="markdown conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class TimeMapping : IMakeXmlSource, IDisposable</code></pre>
  </div>




  <dl class="typelist inheritance">
    <dt>Inheritance</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
      <div><span class="xref">TimeMapping</span></div>
    </dd>
  </dl>

  <dl class="typelist implements">
    <dt>Implements</dt>
    <dd>
      <div><a class="xref" href="Hi.Common.XmlUtils.IMakeXmlSource.html">IMakeXmlSource</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    </dd>
  </dl>


  <dl class="typelist inheritedMembers">
    <dt>Inherited Members</dt>
    <dd>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
    </div>
  </dd></dl>

  <dl class="typelist extensionMethods">
    <dt>Extension Methods</dt>
    <dd>
  <div>
      <a class="xref" href="Hi.Common.DuplicateUtil.html#Hi_Common_DuplicateUtil_TryDuplicate__1___0_System_Object___">DuplicateUtil.TryDuplicate&lt;TSelf&gt;(TSelf, params object[])</a>
  </div>
  <div>
      <a class="xref" href="Hi.Common.InvokeUtil.html#Hi_Common_InvokeUtil_SelfInvoke__1___0_System_Action___0__">InvokeUtil.SelfInvoke&lt;TSrc&gt;(TSrc, Action&lt;TSrc&gt;)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Common.InvokeUtil.html#Hi_Common_InvokeUtil_SelfInvoke__2___0_System_Func___0___1__">InvokeUtil.SelfInvoke&lt;TSrc, TDst&gt;(TSrc, Func&lt;TSrc, TDst&gt;)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Coloring.ColorUtil.html#Hi_Coloring_ColorUtil_GetGloomyColor_System_Object_System_Double_System_Double_">ColorUtil.GetGloomyColor(object, double, double)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Common.NameUtil.html#Hi_Common_NameUtil_GetSelectionName_System_Object_">NameUtil.GetSelectionName(object)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Common.StringUtil.html#Hi_Common_StringUtil_GetPropertyStringIfToStringNotOverloaded_System_Object_System_Boolean_System_Boolean_">StringUtil.GetPropertyStringIfToStringNotOverloaded(object, bool, bool)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Parallels.LockUtil.html#Hi_Parallels_LockUtil_Lock_System_Object_">LockUtil.Lock(object)</a>
  </div>
  </dd></dl>





  <h2 class="section" id="constructors">Constructors
</h2>


  <a id="Hi_Mapping_TimeMapping__ctor_" data-uid="Hi.Mapping.TimeMapping.#ctor*"></a>

  <h3 id="Hi_Mapping_TimeMapping__ctor_Hi_CutterLocations_ClStrips_ClStrip_Hi_Machining_MachiningToolHouse_System_Func_System_String__" data-uid="Hi.Mapping.TimeMapping.#ctor(Hi.CutterLocations.ClStrips.ClStrip,Hi.Machining.MachiningToolHouse,System.Func{System.String})">
  TimeMapping(ClStrip, MachiningToolHouse, Func&lt;string&gt;)
  
  </h3>

  <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="Hi.Mapping.TimeMapping.html">TimeMapping</a> class with the specified CL strip and tool house.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public TimeMapping(ClStrip clStrip, MachiningToolHouse millingToolHouse, Func&lt;string&gt; baseDirectoryGetter)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>clStrip</code> <a class="xref" href="Hi.CutterLocations.ClStrips.ClStrip.html">ClStrip</a></dt>
    <dd><p>The cutter location strip containing the machining steps.</p>
</dd>
    <dt><code>millingToolHouse</code> <a class="xref" href="Hi.Machining.MachiningToolHouse.html">MachiningToolHouse</a></dt>
    <dd><p>The machining tool house containing available tools.</p>
</dd>
    <dt><code>baseDirectoryGetter</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-1">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
    <dd><p>The function to get the base directory for file paths.</p>
</dd>
  </dl>












  <a id="Hi_Mapping_TimeMapping__ctor_" data-uid="Hi.Mapping.TimeMapping.#ctor*"></a>

  <h3 id="Hi_Mapping_TimeMapping__ctor_System_Xml_Linq_XElement_System_Func_System_String__" data-uid="Hi.Mapping.TimeMapping.#ctor(System.Xml.Linq.XElement,System.Func{System.String})">
  TimeMapping(XElement, Func&lt;string&gt;)
  
  </h3>

  <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="Hi.Mapping.TimeMapping.html">TimeMapping</a> class from XML data.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public TimeMapping(XElement src, Func&lt;string&gt; baseDirectoryGetter)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement">XElement</a></dt>
    <dd><p>The XML element containing the mapping data.</p>
</dd>
    <dt><code>baseDirectoryGetter</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-1">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
    <dd><p>The function to get the base directory for resolving relative file paths.</p>
</dd>
  </dl>








  <h4 class="section" id="Hi_Mapping_TimeMapping__ctor_System_Xml_Linq_XElement_System_Func_System_String___remarks">Remarks</h4>
  <div class="markdown level1 remarks"><p>This constructor supports legacy XML formats and automatically converts them to the current format.
Legacy formats include:</p>
<ul>
<li>NcMapping with MarkIdToFileTimeSection element</li>
<li>Entries with MarkID attributes</li>
</ul>
</div>




  <h2 class="section" id="properties">Properties
</h2>


  <a id="Hi_Mapping_TimeMapping_BaseDirectory_" data-uid="Hi.Mapping.TimeMapping.BaseDirectory*"></a>

  <h3 id="Hi_Mapping_TimeMapping_BaseDirectory" data-uid="Hi.Mapping.TimeMapping.BaseDirectory">
  BaseDirectory
  
  </h3>

  <div class="markdown level1 summary"><p>Gets or sets the base directory for resolving file paths.
All relative file paths in the mapping are resolved against this directory.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public string BaseDirectory { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd></dd>
  </dl>








  <a id="Hi_Mapping_TimeMapping_BaseDirectoryGetter_" data-uid="Hi.Mapping.TimeMapping.BaseDirectoryGetter*"></a>

  <h3 id="Hi_Mapping_TimeMapping_BaseDirectoryGetter" data-uid="Hi.Mapping.TimeMapping.BaseDirectoryGetter">
  BaseDirectoryGetter
  
  </h3>

  <div class="markdown level1 summary"><p>Gets or sets the function to get the base directory for resolving file paths.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Func&lt;string&gt; BaseDirectoryGetter { get; set; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-1">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
    <dd></dd>
  </dl>








  <a id="Hi_Mapping_TimeMapping_ClStrip_" data-uid="Hi.Mapping.TimeMapping.ClStrip*"></a>

  <h3 id="Hi_Mapping_TimeMapping_ClStrip" data-uid="Hi.Mapping.TimeMapping.ClStrip">
  ClStrip
  
  </h3>

  <div class="markdown level1 summary"><p>Gets or sets the cutter location strip containing the machining steps.
This is used as a reference for mapping time shots to machining steps.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public ClStrip ClStrip { get; set; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.CutterLocations.ClStrips.ClStrip.html">ClStrip</a></dt>
    <dd></dd>
  </dl>








  <a id="Hi_Mapping_TimeMapping_KeyToRelFileTimeSectionDictionary_" data-uid="Hi.Mapping.TimeMapping.KeyToRelFileTimeSectionDictionary*"></a>

  <h3 id="Hi_Mapping_TimeMapping_KeyToRelFileTimeSectionDictionary" data-uid="Hi.Mapping.TimeMapping.KeyToRelFileTimeSectionDictionary">
  KeyToRelFileTimeSectionDictionary
  
  </h3>

  <div class="markdown level1 summary"><p>Gets or sets the dictionary mapping keys to file time sections.
Each entry maps a unique identifier to a file time section that specifies
which portion of a measurement file corresponds to a particular machining operation.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Dictionary&lt;string, FileTimeSection&gt; KeyToRelFileTimeSectionDictionary { get; set; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>, <a class="xref" href="Hi.Mappings.FileTimeSection.html">FileTimeSection</a>&gt;</dt>
    <dd></dd>
  </dl>








  <a id="Hi_Mapping_TimeMapping_LineReaded_" data-uid="Hi.Mapping.TimeMapping.LineReaded*"></a>

  <h3 id="Hi_Mapping_TimeMapping_LineReaded" data-uid="Hi.Mapping.TimeMapping.LineReaded">
  LineReaded
  
  </h3>

  <div class="markdown level1 summary"><p>Gets or sets the callback action that is invoked when a line is read from a measurement file.
This can be used to track progress during file loading operations.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Action&lt;int&gt; LineReaded { get; set; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>&gt;</dt>
    <dd></dd>
  </dl>




  <h4 class="section" id="Hi_Mapping_TimeMapping_LineReaded_remarks">Remarks</h4>
  <div class="markdown level1 remarks"><p>The parameter passed to the action is the current line number being read.</p>
</div>




  <a id="Hi_Mapping_TimeMapping_MillingToolHouse_" data-uid="Hi.Mapping.TimeMapping.MillingToolHouse*"></a>

  <h3 id="Hi_Mapping_TimeMapping_MillingToolHouse" data-uid="Hi.Mapping.TimeMapping.MillingToolHouse">
  MillingToolHouse
  
  </h3>

  <div class="markdown level1 summary"><p>Gets or sets the machining tool house containing available tools.
This is used to determine tool-specific parameters during mapping.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public MachiningToolHouse MillingToolHouse { get; set; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Machining.MachiningToolHouse.html">MachiningToolHouse</a></dt>
    <dd></dd>
  </dl>








  <a id="Hi_Mapping_TimeMapping_RelFileToTimeShotListDictionary_" data-uid="Hi.Mapping.TimeMapping.RelFileToTimeShotListDictionary*"></a>

  <h3 id="Hi_Mapping_TimeMapping_RelFileToTimeShotListDictionary" data-uid="Hi.Mapping.TimeMapping.RelFileToTimeShotListDictionary">
  RelFileToTimeShotListDictionary
  
  </h3>

  <div class="markdown level1 summary"><p>Gets or sets the cache of time shot lists loaded from files.
This is a thread-safe dictionary that maps file paths to tasks that load and parse the files.
The cache prevents multiple reads of the same file and enables concurrent access.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public ConcurrentDictionary&lt;string, Task&lt;List&lt;ITimeShot&gt;&gt;&gt; RelFileToTimeShotListDictionary { get; set; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2">ConcurrentDictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1">Task</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Mapping.ITimeShot.html">ITimeShot</a>&gt;&gt;&gt;</dt>
    <dd></dd>
  </dl>








  <a id="Hi_Mapping_TimeMapping_StepToTimeShotListDictionary_" data-uid="Hi.Mapping.TimeMapping.StepToTimeShotListDictionary*"></a>

  <h3 id="Hi_Mapping_TimeMapping_StepToTimeShotListDictionary" data-uid="Hi.Mapping.TimeMapping.StepToTimeShotListDictionary">
  StepToTimeShotListDictionary
  
  </h3>

  <div class="markdown level1 summary"><p>Gets a concurrent dictionary mapping step indices to their corresponding time shot lists.
This dictionary is populated during the mapping process.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public ConcurrentDictionary&lt;int, List&lt;ITimeShot&gt;&gt; StepToTimeShotListDictionary { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2">ConcurrentDictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Mapping.ITimeShot.html">ITimeShot</a>&gt;&gt;</dt>
    <dd></dd>
  </dl>








  <a id="Hi_Mapping_TimeMapping_XName_" data-uid="Hi.Mapping.TimeMapping.XName*"></a>

  <h3 id="Hi_Mapping_TimeMapping_XName" data-uid="Hi.Mapping.TimeMapping.XName">
  XName
  
  </h3>

  <div class="markdown level1 summary"><p>Gets the XML element name used for serialization.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static string XName { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd></dd>
  </dl>




  <h4 class="section" id="Hi_Mapping_TimeMapping_XName_remarks">Remarks</h4>
  <div class="markdown level1 remarks"><p>This name is used as the root element when serializing TimeMapping instances to XML.
It matches the class name to maintain consistency between code and XML representation.</p>
</div>




  <h2 class="section" id="methods">Methods
</h2>


  <a id="Hi_Mapping_TimeMapping_CallTimeShotByRelFile_" data-uid="Hi.Mapping.TimeMapping.CallTimeShotByRelFile*"></a>

  <h3 id="Hi_Mapping_TimeMapping_CallTimeShotByRelFile_System_String_System_Nullable_System_Threading_CancellationToken__" data-uid="Hi.Mapping.TimeMapping.CallTimeShotByRelFile(System.String,System.Nullable{System.Threading.CancellationToken})">
  CallTimeShotByRelFile(string, CancellationToken?)
  
  </h3>

  <div class="markdown level1 summary"><p>Retrieves time shots from a file, using cached results if available.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public List&lt;ITimeShot&gt; CallTimeShotByRelFile(string relFile, CancellationToken? cancellationToken = null)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>relFile</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>The relative path to the file containing time shots.</p>
</dd>
    <dt><code>cancellationToken</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a>?</dt>
    <dd><p>Optional token to cancel the loading operation.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Mapping.ITimeShot.html">ITimeShot</a>&gt;</dt>
    <dd><p>A list of time shots from the file. The results are cached for subsequent calls.
If the file is already being loaded by another thread, waits for that operation to complete.</p>
</dd>
  </dl>







  <h4 class="section" id="Hi_Mapping_TimeMapping_CallTimeShotByRelFile_System_String_System_Nullable_System_Threading_CancellationToken___remarks">Remarks</h4>
  <div class="markdown level1 remarks"><p>This method is thread-safe and ensures each file is only read once, even with concurrent access.
Any exceptions during file reading are captured and can be inspected through the task's exception property.</p>
</div>




  <a id="Hi_Mapping_TimeMapping_Clear_" data-uid="Hi.Mapping.TimeMapping.Clear*"></a>

  <h3 id="Hi_Mapping_TimeMapping_Clear" data-uid="Hi.Mapping.TimeMapping.Clear">
  Clear()
  
  </h3>

  <div class="markdown level1 summary"><p>Clears all mappings and data, including the key-to-file time section dictionary.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Clear()</code></pre>
  </div>













  <a id="Hi_Mapping_TimeMapping_ClearCache_" data-uid="Hi.Mapping.TimeMapping.ClearCache*"></a>

  <h3 id="Hi_Mapping_TimeMapping_ClearCache" data-uid="Hi.Mapping.TimeMapping.ClearCache">
  ClearCache()
  
  </h3>

  <div class="markdown level1 summary"><p>Clears the cache of loaded time shot data, including file-to-time shot list and step-to-time shot list dictionaries.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void ClearCache()</code></pre>
  </div>













  <a id="Hi_Mapping_TimeMapping_Dispose_" data-uid="Hi.Mapping.TimeMapping.Dispose*"></a>

  <h3 id="Hi_Mapping_TimeMapping_Dispose" data-uid="Hi.Mapping.TimeMapping.Dispose">
  Dispose()
  
  </h3>

  <div class="markdown level1 summary"><p>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
  </div>













  <a id="Hi_Mapping_TimeMapping_Dispose_" data-uid="Hi.Mapping.TimeMapping.Dispose*"></a>

  <h3 id="Hi_Mapping_TimeMapping_Dispose_System_Boolean_" data-uid="Hi.Mapping.TimeMapping.Dispose(System.Boolean)">
  Dispose(bool)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">protected virtual void Dispose(bool disposing)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>disposing</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd></dd>
  </dl>












  <a id="Hi_Mapping_TimeMapping_GetShots_" data-uid="Hi.Mapping.TimeMapping.GetShots*"></a>

  <h3 id="Hi_Mapping_TimeMapping_GetShots_System_Int32_" data-uid="Hi.Mapping.TimeMapping.GetShots(System.Int32)">
  GetShots(int)
  
  </h3>

  <div class="markdown level1 summary"><p>Gets the time shots associated with a specific step index.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public List&lt;ITimeShot&gt; GetShots(int stepIndex)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>stepIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The index of the step to get shots for.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Mapping.ITimeShot.html">ITimeShot</a>&gt;</dt>
    <dd><p>A list of time shots associated with the specified step, or null if no shots are found.</p>
</dd>
  </dl>











  <a id="Hi_Mapping_TimeMapping_LoadTimeShotFiles_" data-uid="Hi.Mapping.TimeMapping.LoadTimeShotFiles*"></a>

  <h3 id="Hi_Mapping_TimeMapping_LoadTimeShotFiles_System_Nullable_System_Threading_CancellationToken__" data-uid="Hi.Mapping.TimeMapping.LoadTimeShotFiles(System.Nullable{System.Threading.CancellationToken})">
  LoadTimeShotFiles(CancellationToken?)
  
  </h3>

  <div class="markdown level1 summary"><p>Loads all time shot files referenced in the KeyToFileTimeSectionMapping.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void LoadTimeShotFiles(CancellationToken? cancellationToken = null)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>cancellationToken</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a>?</dt>
    <dd><p>Optional cancellation token to cancel the operation.</p>
</dd>
  </dl>












  <a id="Hi_Mapping_TimeMapping_MakeXmlSource_" data-uid="Hi.Mapping.TimeMapping.MakeXmlSource*"></a>

  <h3 id="Hi_Mapping_TimeMapping_MakeXmlSource_System_String_System_String_System_Boolean_" data-uid="Hi.Mapping.TimeMapping.MakeXmlSource(System.String,System.String,System.Boolean)">
  MakeXmlSource(string, string, bool)
  
  </h3>

  <div class="markdown level1 summary"><p>Creates an XML representation of the time mapping data.
<code class="paramref">relFile</code> is not used in current implementation.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>The base directory for resolving relative paths</p>
</dd>
    <dt><code>relFile</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>The relative file path for the XML source</p>
</dd>
    <dt><code>exhibitionOnly</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p>if true, the extended file creation is suppressed.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement">XElement</a></dt>
    <dd><p>An XML element containing the complete time mapping data.</p>
</dd>
  </dl>







  <h4 class="section" id="Hi_Mapping_TimeMapping_MakeXmlSource_System_String_System_String_System_Boolean__remarks">Remarks</h4>
  <div class="markdown level1 remarks"><p>The XML structure includes:</p>
<ul>
<li>A root TimeMapping element</li>
<li>An Entrys element containing Entry elements</li>
<li>Each Entry has a Key attribute and FileTimeSection child element</li>
</ul>
</div>




  <a id="Hi_Mapping_TimeMapping_Map_" data-uid="Hi.Mapping.TimeMapping.Map*"></a>

  <h3 id="Hi_Mapping_TimeMapping_Map_Hi_Common_Range_System_Int32__Hi_Mappings_FileTimeSection_Hi_Mapping_StepTimeShotUtil_CycleSamplingMode_System_Nullable_System_Threading_CancellationToken__" data-uid="Hi.Mapping.TimeMapping.Map(Hi.Common.Range{System.Int32},Hi.Mappings.FileTimeSection,Hi.Mapping.StepTimeShotUtil.CycleSamplingMode,System.Nullable{System.Threading.CancellationToken})">
  Map(Range&lt;int&gt;, FileTimeSection, CycleSamplingMode, CancellationToken?)
  
  </h3>

  <div class="markdown level1 summary"><p>Maps the specified step section to time shots using the provided file time section and cycle sampling mode.
This method is thread-safe and can be called concurrently.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Map(Range&lt;int&gt; stepSection, FileTimeSection relFileTimeSection, StepTimeShotUtil.CycleSamplingMode cycleSamplingMode, CancellationToken? cancellationToken = null)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>stepSection</code> <a class="xref" href="Hi.Common.Range-1.html">Range</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>&gt;</dt>
    <dd><p>The range of step indices to process.</p>
</dd>
    <dt><code>relFileTimeSection</code> <a class="xref" href="Hi.Mappings.FileTimeSection.html">FileTimeSection</a></dt>
    <dd><p>The file time section containing file path and time range.</p>
</dd>
    <dt><code>cycleSamplingMode</code> <a class="xref" href="Hi.Mapping.StepTimeShotUtil.html">StepTimeShotUtil</a>.<a class="xref" href="Hi.Mapping.StepTimeShotUtil.CycleSamplingMode.html">CycleSamplingMode</a></dt>
    <dd><p>The cycle sampling mode to use.</p>
</dd>
    <dt><code>cancellationToken</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a>?</dt>
    <dd><p>Optional cancellation token to cancel the operation.</p>
</dd>
  </dl>












  <a id="Hi_Mapping_TimeMapping_MapByActualTime_" data-uid="Hi.Mapping.TimeMapping.MapByActualTime*"></a>

  <h3 id="Hi_Mapping_TimeMapping_MapByActualTime_System_String_Hi_Mapping_StepTimeShotUtil_CycleSamplingMode_Hi_MachiningProcs_SessionMessageHost_System_Nullable_System_Threading_CancellationToken__" data-uid="Hi.Mapping.TimeMapping.MapByActualTime(System.String,Hi.Mapping.StepTimeShotUtil.CycleSamplingMode,Hi.MachiningProcs.SessionMessageHost,System.Nullable{System.Threading.CancellationToken})">
  MapByActualTime(string, CycleSamplingMode, SessionMessageHost, CancellationToken?)
  
  </h3>

  <div class="markdown level1 summary"><p>Maps steps to time shots based on actual time.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void MapByActualTime(string timeShotRelFile, StepTimeShotUtil.CycleSamplingMode cycleSamplingMode, SessionMessageHost sessionMessageHost, CancellationToken? cancellationToken = null)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>timeShotRelFile</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>The relative file path for time shots.</p>
</dd>
    <dt><code>cycleSamplingMode</code> <a class="xref" href="Hi.Mapping.StepTimeShotUtil.html">StepTimeShotUtil</a>.<a class="xref" href="Hi.Mapping.StepTimeShotUtil.CycleSamplingMode.html">CycleSamplingMode</a></dt>
    <dd><p>The cycle sampling mode.</p>
</dd>
    <dt><code>sessionMessageHost</code> <a class="xref" href="Hi.MachiningProcs.SessionMessageHost.html">SessionMessageHost</a></dt>
    <dd><p>The session message host for logging.</p>
</dd>
    <dt><code>cancellationToken</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a>?</dt>
    <dd><p>The cancellation token.</p>
</dd>
  </dl>












  <a id="Hi_Mapping_TimeMapping_WaitMapping_" data-uid="Hi.Mapping.TimeMapping.WaitMapping*"></a>

  <h3 id="Hi_Mapping_TimeMapping_WaitMapping" data-uid="Hi.Mapping.TimeMapping.WaitMapping">
  WaitMapping()
  
  </h3>

  <div class="markdown level1 summary"><p>Waits for all mapping operations to complete.
This method blocks until all concurrent mapping tasks have finished.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void WaitMapping()</code></pre>
  </div>














</article>

        <div class="contribution d-print-none">
        </div>


      </div>

      <div class="affix">
        <nav id="affix"></nav>
      </div>
    </main>

    <div class="container-xxl search-results" id="search-results"></div>

    <footer class="border-top text-secondary">
      <div class="container-xxl">
        <div class="flex-fill">
          <span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
        </div>
      </div>
    </footer>
  </body>
</html>
